<template>
  <a-layout style="min-height: 100vh">
    <a-layout-sider v-model:collapsed="collapsed" collapsible>
      <a-menu v-model:selectedKeys="selectedKeys" theme="dark" mode="inline">
        <a-menu-item key="home" @click="router.push('/content')">
          <pie-chart-outlined />
          <span>主页</span>
        </a-menu-item>
        <a-sub-menu key="interface">
          <template #title>
            <span>
              <align-center-outlined />
              <span>接口信息</span>
            </span>
          </template>
          <a-menu-item key="interface" @click="router.push('/interface')">查看接口</a-menu-item>
        </a-sub-menu>
        <a-menu-item key="user" @click="router.push('/user')">
          <user-outlined />
          <span>个人中心</span>
        </a-menu-item>
        <a-sub-menu key="toUse">
          <template #title>
            <span>
              <align-center-outlined />
              <span>使用手册</span>
            </span>
          </template>
          <a-menu-item key="manual" @click="router.push('/manual')">查看手册</a-menu-item>
          <a-menu-item key="example" @click="router.push('/example')">java示例</a-menu-item>
        </a-sub-menu>
        <a-menu-item key="oj" @click="router.push('/oj/index')">
          <desktop-outlined />
          <span>OJ</span>
        </a-menu-item>
      </a-menu>
    </a-layout-sider>

    <a-layout-content>
      <router-view>

      </router-view>
    </a-layout-content>

  </a-layout>
</template>
<script lang="ts" setup>
import {
  AlignCenterOutlined,
  PieChartOutlined,
  UserOutlined,
  DesktopOutlined,
} from '@ant-design/icons-vue';
import { ref ,onMounted} from 'vue';
import axios from '@/config/axios'
import {useRouter} from 'vue-router'



onMounted(()=>{
  getCurrentUser()
})

const router= useRouter()

const currentUser = ref()

const getCurrentUser = async()=>{
  await axios.get('/user/get/login').then((res)=>{
    currentUser.value = res.data.data
  })
}
const collapsed = ref<boolean>(false);
const selectedKeys = ref<string>(['1']);
</script>

<style scoped>

</style>
